package com.trainbook.controller;


import com.trainbook.common.result.JsonResult;
import com.trainbook.service.ISite2siteService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * <p>
 * 站点与站点间相连的表 前端控制器
 * </p>
 *
 * @author Dempsey
 * @since 2020-11-27
 */
@Controller
@RequestMapping("/site2site")
public class Site2siteController {

    @Autowired
    private ISite2siteService site2siteService;

    @GetMapping("/removeSite2Site")
    @ApiOperation(value = "删除一个站点间联系", notes = "对siteA,siteB的顺序不做要求")
    @ApiImplicitParams(value = {@ApiImplicitParam(name = "siteA", value = "站点间联系的站点A", dataType = "Integer"),
            @ApiImplicitParam(name = "siteB", value = "站点间联系的站点B", dataType = "Integer")})
    public JsonResult removeSite2Site(@RequestBody int siteA,@RequestBody int siteB){
        return site2siteService.removeSite2Site(siteA, siteB);
    }

}

